function Stack() {
    this.dataStore = [];
    this.top = 0;
}
Stack.prototype.push = function(element) {
    this.dataStore[this.top++] = element;
}
Stack.prototype.pop = function() {
    return this.dataStore[--this.top];
}
Stack.prototype.peek = function() {
    return this.dataStore[this.top - 1];
}
Stack.prototype.getLength = function() {
    return this.top;
}
Stack.prototype.clear = function() {
    this.top = 0;
}
var s = new Stack();
s.push('David');
s.push('Raymond');
s.push('Bryan');
console.log('length:', s.getLength());
var popped = s.pop();
console.log('popped:', popped);